package cn.shopping.service.impl.Franchisees;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.shopping.dao.franchisees.FranchiseesMapper;
import cn.shopping.pojo.Sh_franchisees;
import cn.shopping.pojo.Sh_total;
import cn.shopping.service.Franchisees.FranchiseesService;

@Service
public class FranchiseesServiceimpl implements FranchiseesService{

	@Autowired
	private FranchiseesMapper franchiseesMapper;
	
	@Override
	public List<Sh_franchisees> selallfranchisees() {
		return franchiseesMapper.selallfranchisees();
	}

	@Override
	public boolean addtotal(Sh_total total) {
		boolean flag = false;
		if (franchiseesMapper.addtotal(total)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean addfrance(Sh_franchisees franch) {
		boolean flag = false;
		if (franchiseesMapper.addfrance(franch)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public int selmaxtotalid() {
		return franchiseesMapper.selmaxtotalid();
	}

	@Override
	public boolean deltotaladd(int total_id) {
		boolean flag = false;
		if (franchiseesMapper.deltotaladd(total_id)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean delfranch(int id) {
		boolean flag = false;
		if (franchiseesMapper.delfranch(id)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public Sh_franchisees getfranchiseesbyId(int id) {
		return franchiseesMapper.selfranchiseesbyId(id);
	}

	@Override
	public boolean modifytotal(Sh_total total) {
		boolean flag = false;
		if (franchiseesMapper.modifytotal(total)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean modifyfranch(Sh_franchisees franch) {
		boolean flag = false;
		if (franchiseesMapper.modifyfranch(franch)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public List<Sh_franchisees> selresults() {
		return franchiseesMapper.selresults();
	}

}
